using System;
using System.ComponentModel.DataAnnotations;
using Microsoft.EntityFrameworkCore;

namespace Terra.Data.Entities.Logging;

/// <summary>
/// 日志实体基类
/// </summary>
public abstract class LogEntityBase : AuditEntityBase<Guid>
{
    /// <summary>
    /// 日志级别
    /// </summary>
    [Required]
    [MaxLength(32)]
    [Comment("日志级别：如 Information、Warning、Error 等")]
    public string Level { get; set; }

    /// <summary>
    /// IP地址
    /// </summary>
    [MaxLength(64)]
    [Comment("IP地址")]
    public string IpAddress { get; set; }

    /// <summary>
    /// 浏览器信息
    /// </summary>
    [MaxLength(256)]
    [Comment("浏览器信息")]
    public string Browser { get; set; }

    /// <summary>
    /// 操作系统
    /// </summary>
    [MaxLength(128)]
    [Comment("操作系统信息")]
    public string OS { get; set; }

    /// <summary>
    /// 设备信息
    /// </summary>
    [MaxLength(128)]
    [Comment("设备信息")]
    public string Device { get; set; }

    /// <summary>
    /// 租户ID
    /// </summary>
    [MaxLength(50)]
    [Comment("租户ID")]
    public Guid? TenantId { get; set; }
}
